import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { LayerManagerComponent } from './layer-manager.component';
import { LayerListComponent } from './layer-list/layer-list.component';

const routes: Routes = [
  {
    path: '',
    component: LayerManagerComponent,
    children: [
      {
        path: '',
        redirectTo: 'list',
        pathMatch: 'full'
      },
      {
        path: 'list',
        component: LayerListComponent,
        data: {
          name: '图层列表'
        }
      },
      {
        path: 'add',
        loadChildren: './layer-forms/layer-forms.module#LayerFormsModule',
        data: {
          name: '新建图层'
        }
      },
      {
        path: 'edit/:id',
        loadChildren: './layer-forms/layer-forms.module#LayerFormsModule',
        data: {
          name: '编辑图层'
        }
      }
    ]
  }
];

@NgModule({
  imports: [RouterModule.forChild(routes)],
  exports: [RouterModule]
})
export class LayerManagerRoutingModule { }
